package com.shangxia.monomer.study.designPatterns.behavioralType.state.demoSed;

import lombok.extern.slf4j.Slf4j;

/**
 * @ProjectName: monomer
 * @ClassName: WorkClient
 * @Time: 2021/8/6
 * @Author: zhouy
 * @Description:
 * @Experience:
 */

@Slf4j
public class WorkClient {
    public static void main(String[] args) {
        int hour = 9;
        Work work = new Work(hour,new ForenoonWorkState());
        while (work.getHour()>0){
            System.out.println("hour = "+work.getHour());
            work.writeProgram();
            work.setHour(work.getHour()+1);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            if (work.getHour()>22){
                break;
            }
        }
    }
}
